package com.javase.innerClass;

import org.junit.jupiter.api.Test;

/**
 * @Auther: liyanhao
 * @Description: 鸟
 * @Date: 2022/5/18 12:45
 * @Version: v1.0
 */
public abstract class Bird {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public abstract int fly();

    public static class Test {
        public void test(Bird bird) {
            System.out.println(bird.getName() + "能够飞 " + bird.fly() + "米");
        }
    }


}
class TestMain{
    public static void main(String[] args) {
            Bird.Test test = new Bird.Test();
            test.test(new Bird() {
                @Override
                public int fly() {
                    return 10000;
                }

                @Override
                public String getName() {
                    return "大雁";
                }
            });
    }
}
